package com.booter.webflux.controller;

import com.booter.webflux.model.User;
import com.booter.webflux.repository.mysql.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

@RestController
@RequestMapping("r2dbc/user")
public class R2dbcController {

    @Autowired
    private UserRepository repository;

    @RequestMapping("list")
    public Flux<User> userList() {
        return this.repository.findAll();
    }

}
